package sketch.icse11nier;

import java.util.LinkedList;
import java.util.List;

import org.eclipse.jdt.core.dom.BodyDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;

import sketch.ast.ASTUtils;
import sketch.main.GeneratingTests;
import sketch.specs.MethodDumperAfterRemovingUnusedVars;
import sketch.specs.SketchedMethodDeclaration;
import sketch.specs.SketchedMethodsCreator;
import sketch.util.Globals;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ValuesChooseTest extends TestCase {
	
	public static Test suite() {
		return new TestSuite(ValuesChooseTest.class);
	}
	
	//the test sketch file
	String testSketchFile = "./tests/sketch/icse11nier/Z_Sketch_ChooseValue.java";
	
	//to output the expanded tests in a specified place
	String outputFileDir = "./tests/sketch/icse11nier/autogenerated/";
	String packageName = "sketch.icse11nier.autogenerated";
	String outputClassName = "TestsGeneratedForChooseAndExhaust";
	
	public void testGeneratingTests() {
		SketchedMethodsCreator creator = new SketchedMethodsCreator(testSketchFile);
		List<SketchedMethodDeclaration> sketchedMethods = creator.createSketchedMethodList();
		
		//we only have two test sketches
		assertEquals(2, sketchedMethods.size());
		
		GeneratingTests.generateTestsAndWriteToFile(sketchedMethods, creator.getUnit(),
				outputFileDir, packageName, outputClassName);
	}
}